#include "myDataset.h"

template <typename _T>
vector<myDataset<_T>> Bagging(myDataset<_T> &Dataset, int size, int numRecord)
{
	srand(time(NULL));

	vector<myDataset<_T>> result(size);

	for(int k=0; k< size; k++)
	{
		myDataset<_T> tmp;

		for(int i = 0; i < numRecord; i ++)
		{
			int index = rand() % Dataset.size();
			tmp.addRecord(*Dataset.getRecord(index));
		}

		result[k] = tmp;
	}

	return result;

}